﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using tienit.core;
using System.Collections;
using Microsoft.VisualBasic;
using FastColoredTextBoxNS;
using System.Text.RegularExpressions;

namespace TIENITCodeGener
{
    public partial class frmGen : Form
    {

#region "Variables"
        private string ROOT_PATH;
        private List<String> LST_CLASS_NAME;
        private ArrayList ARR_COLUMN = new ArrayList();
        private int WEB_OR_WIN; //1:WEB, 2:WIN, 3:ALL
        private int SS_OR_ORA; //1:SS, 2:ORA
        private int NET_OR_JAVA; //1:NET, 2:JAVA
        private List<ColumnInfo> LST_COL_INFO;
        private frmLoading m_Frm_Loading;

        //TextStyle BlueStyle = new TextStyle(Brushes.Blue, null, FontStyle.Regular);
        //TextStyle BoldStyle = new TextStyle(null, null, FontStyle.Bold | FontStyle.Underline);
        //TextStyle GrayStyle = new TextStyle(Brushes.Gray, null, FontStyle.Regular);
        //TextStyle MagentaStyle = new TextStyle(Brushes.Magenta, null, FontStyle.Regular);
        //TextStyle GreenStyle = new TextStyle(Brushes.Green, null, FontStyle.Italic);
        //TextStyle BrownStyle = new TextStyle(Brushes.Brown, null, FontStyle.Italic);
        //TextStyle MaroonStyle = new TextStyle(Brushes.Maroon, null, FontStyle.Regular);
        //MarkerStyle SameWordsStyle = new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.Gray)));
#endregion
       
#region "Constructor"
        public frmGen()
        {
            InitializeComponent();
            ITFACommon.SetFormIcon(this);
            SetLanguage();
        }
#endregion

#region "Form Events"
        private void frmGen_Load(object sender, EventArgs e)
        {
            try
            {
                ITFACommon.Fill_Data_To_TreeView(ITFACommon.LIST_DATAS, tvTable);
                groupBox_TABLES.Text = groupBox_TABLES.Text + " (" + ITFACommon.LIST_DATAS.Count.ToString() + ")";
                pn_BOUND_TABLES.Location = new Point(3, 29);
                //Visible Setting
                string genOption = "";
                if (TIENITCodeGener.Properties.Settings.Default.Sub_Catalog.Equals("DOTNET"))
                {
                    genOption = TIENITCodeGener.Properties.Settings.Default.Option_For_Gen_Code;
                }
                else if (TIENITCodeGener.Properties.Settings.Default.Sub_Catalog.Equals("JAVA"))
                {
                    genOption = TIENITCodeGener.Properties.Settings.Default.Option_For_Gen_Code_J;
                }
                
                SetOptionForGen(genOption);
                SS_OR_ORA = ITFACommon.Visible_Ora_Or_SS(genOption);
                NET_OR_JAVA = ITFACommon.Visible_Net_Or_Java(genOption);
                DisplayTitle(genOption);
                InitStylesPriority();
                SetLanguageForRichBox();
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void frmGen_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Close();
            }
        }

        private void SetLanguage()
        {
            if (TIENITCodeGener.Properties.Settings.Default.Soft_Language.Equals("EN-US"))
            {
                lbl_Title.Text = "Generate Code && Script";
                this.Text = "Generate Code && Script";
                groupBox_TABLES.Text = "Tables";
                groupBox_CODE.Text = "Code";
                btnGen.Text = "Save To Folder";
            }
            else if (TIENITCodeGener.Properties.Settings.Default.Soft_Language.Equals("VI-VN"))
            {
                lbl_Title.Text = "Tạo mã nguồn";
                this.Text = "Tạo mã nguồn";
                groupBox_TABLES.Text = "Bảng dữ liệu";
                groupBox_CODE.Text = "Mã nguồn";
                btnGen.Text = "Lưu tới thư mục";
            }
        }
#endregion

#region "Do Load"
        private void DisplayTitle(string genOption)
        {
            string _LANG = "";
            string _DBMS = "";
            string _WEB_OR_WIN_OR_BOTH = "";
            
            if (genOption.Substring(0, 1).Equals("1"))
            {
                _LANG = ".NET";
            }
            else
            {
                _LANG = "JAVA";
            }

            if (genOption.Substring(1, 1).Equals("1"))
            {
                _DBMS = "SQL Server";
            }
            else
            {
                _DBMS = "Oracle";
            }

            if (genOption.Length == 3)
            {
                if (genOption.Substring(2,1).Equals("1"))
                {
                    _WEB_OR_WIN_OR_BOTH = "Website";
                }
                else
                {
                    _WEB_OR_WIN_OR_BOTH = "Windows";
                }
            }
            else
            {
                _WEB_OR_WIN_OR_BOTH = "Web and Win";
            }

            lbl_Lang_DBMS.Text = _LANG + " - " + _DBMS + " - " + _WEB_OR_WIN_OR_BOTH;
        }

        private void InitStylesPriority()
        {
            //WIN - .NET - SS
            txt_win_net_ss_DataProvider.ClearStylesBuffer();
            txt_win_net_ss_Controller.ClearStylesBuffer();
            txt_win_net_ss_ObjectInfo.ClearStylesBuffer();
            txt_win_net_ss_Common.ClearStylesBuffer();
            txt_win_net_ss_FormClass.ClearStylesBuffer();
            txt_win_net_ss_Note.ClearStylesBuffer();

            //WEB - .NET - SS (DNN)
            txt_web_net_ss_DataProvider.ClearStylesBuffer();
            txt_web_net_ss_SQLDataProvider.ClearStylesBuffer();
            txt_web_net_ss_ObjectInfo.ClearStylesBuffer();
            txt_web_net_ss_Controller.ClearStylesBuffer();
            txt_web_net_ss_Common.ClearStylesBuffer();
            txt_web_net_ss_WebForm.ClearStylesBuffer();
            txt_web_net_ss_Note.ClearStylesBuffer();

            //WEB - .NET - SS (NORMAL)
            txt_web_net_ss_DataProvider_NM.ClearStylesBuffer();
            txt_web_net_ss_Controller_NM.ClearStylesBuffer();
            txt_web_net_ss_ObjectInfo_NM.ClearStylesBuffer();
            txt_web_net_ss_Common_NM.ClearStylesBuffer();
            txt_web_net_ss_WebForm_NM.ClearStylesBuffer();
            txt_web_net_ss_Note_NM.ClearStylesBuffer();

            //WIN - .NET - ORA
            txt_WIN_NET_ORACLE_DAO.ClearStylesBuffer();
            txt_WIN_NET_ORACLE_BO.ClearStylesBuffer();
            txt_WIN_NET_ORACLE_ObjectInfo.ClearStylesBuffer();
            txt_WIN_NET_ORACLE_Common.ClearStylesBuffer();
            txt_WIN_NET_ORACLE_Note.ClearStylesBuffer();

            //WEB - .NET - ORA
            txt_WEB_NET_ORACLE_DAO.ClearStylesBuffer();
            txt_WEB_NET_ORACLE_BO.ClearStylesBuffer();
            txt_WEB_NET_ORACLE_ObjectInfo.ClearStylesBuffer();
            txt_WEB_NET_ORACLE_Common.ClearStylesBuffer();
            txt_WEB_NET_ORACLE_WebForm.ClearStylesBuffer();
            txt_WEB_NET_ORACLE_Note.ClearStylesBuffer();
        }

        private void SetFormatCodeForCSharp()
        {
            string langNET = TIENITCodeGener.Properties.Settings.Default.NET_Language;
            if (langNET.Equals("CS"))
            {
                string gen_option = "";
                if (TIENITCodeGener.Properties.Settings.Default.Sub_Catalog.Equals("DOTNET"))
                {
                    gen_option = TIENITCodeGener.Properties.Settings.Default.Option_For_Gen_Code;
                }
                else if (TIENITCodeGener.Properties.Settings.Default.Sub_Catalog.Equals("JAVA"))
                {
                    gen_option = TIENITCodeGener.Properties.Settings.Default.Option_For_Gen_Code_J;
                }
                bool IsDNN = TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported;

                if (gen_option.Substring(0, 1).Equals("1")) //NET
                {
                    if (gen_option.Substring(1, 1).Equals("1")) //SS
                    {
                        if (gen_option.Length == 3)
                        {
                            if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                            {
                                //WEB - NET - SS
                                if (IsDNN == true)
                                {
                                    CSFormat(txt_web_net_ss_DataProvider);
                                    CSFormat(txt_web_net_ss_SQLDataProvider);
                                    CSFormat(txt_web_net_ss_ObjectInfo);
                                    CSFormat(txt_web_net_ss_Controller);
                                    CSFormat(txt_web_net_ss_Common);
                                    //CSFormat(txt_web_net_ss_WebForm);
                                    //CSFormat(txt_web_net_ss_Note);
                                }
                                else
                                {
                                    CSFormat(txt_web_net_ss_DataProvider_NM);
                                    CSFormat(txt_web_net_ss_Controller_NM);
                                    CSFormat(txt_web_net_ss_ObjectInfo_NM);
                                    CSFormat(txt_web_net_ss_Common_NM);
                                    //CSFormat(txt_web_net_ss_WebForm_NM);
                                    //CSFormat(txt_web_net_ss_Note_NM);
                                }
                            }
                            else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                            {
                                //WIN - NET - SS
                                CSFormat(txt_win_net_ss_DataProvider);
                                CSFormat(txt_win_net_ss_Controller);
                                CSFormat(txt_win_net_ss_ObjectInfo);
                                CSFormat(txt_win_net_ss_Common);
                                //CSFormat(txt_win_net_ss_FormClass);
                                //CSFormat(txt_win_net_ss_Note);
                            }
                        }
                        else if (gen_option.Length == 6) // WEB + WIN
                        {
                            //WEB and WIN - NET - SS
                            if (IsDNN == true)
                            {
                                CSFormat(txt_web_net_ss_DataProvider);
                                CSFormat(txt_web_net_ss_SQLDataProvider);
                                CSFormat(txt_web_net_ss_ObjectInfo);
                                CSFormat(txt_web_net_ss_Controller);
                                CSFormat(txt_web_net_ss_Common);
                                //CSFormat(txt_web_net_ss_WebForm);
                                //CSFormat(txt_web_net_ss_Note);
                            }
                            else
                            {
                                CSFormat(txt_web_net_ss_DataProvider_NM);
                                CSFormat(txt_web_net_ss_Controller_NM);
                                CSFormat(txt_web_net_ss_ObjectInfo_NM);
                                CSFormat(txt_web_net_ss_Common_NM);
                                //CSFormat(txt_web_net_ss_WebForm_NM);
                                //CSFormat(txt_web_net_ss_Note_NM);
                            }
                            //
                            CSFormat(txt_win_net_ss_DataProvider);
                            CSFormat(txt_win_net_ss_Controller);
                            CSFormat(txt_win_net_ss_ObjectInfo);
                            CSFormat(txt_win_net_ss_Common);
                            //CSFormat(txt_win_net_ss_FormClass);
                            //CSFormat(txt_win_net_ss_Note);
                        }
                    }
                    else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                    {
                        if (gen_option.Length == 3)
                        {
                            if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                            {
                                //WEB - NET - ORA
                                CSFormat_ORA(txt_WEB_NET_ORACLE_DAO);
                                CSFormat_ORA(txt_WEB_NET_ORACLE_BO);
                                CSFormat_ORA(txt_WEB_NET_ORACLE_ObjectInfo);
                                //CSFormat(txt_WEB_NET_ORACLE_WebForm);
                                //CSFormat(txt_WEB_NET_ORACLE_Common);
                                //CSFormat(txt_WEB_NET_ORACLE_Note);
                            }
                            else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                            {
                                //WIN - NET - ORA
                                CSFormat_ORA(txt_WIN_NET_ORACLE_DAO);
                                CSFormat_ORA(txt_WIN_NET_ORACLE_BO);
                                CSFormat_ORA(txt_WIN_NET_ORACLE_ObjectInfo);
                                //CSFormat(txt_WIN_NET_ORACLE_Common);
                                //CSFormat(txt_WIN_NET_ORACLE_Note);
                            }
                        }
                        else if (gen_option.Length == 6) // WEB + WIN
                        {
                            //WEB and WIN - NET - ORA
                            CSFormat_ORA(txt_WEB_NET_ORACLE_DAO);
                            CSFormat_ORA(txt_WEB_NET_ORACLE_BO);
                            CSFormat_ORA(txt_WEB_NET_ORACLE_ObjectInfo);
                            //CSFormat(txt_WEB_NET_ORACLE_WebForm);
                            //CSFormat(txt_WEB_NET_ORACLE_Common);
                            //CSFormat(txt_WEB_NET_ORACLE_Note);
                            //
                            CSFormat_ORA(txt_WIN_NET_ORACLE_DAO);
                            CSFormat_ORA(txt_WIN_NET_ORACLE_BO);
                            CSFormat_ORA(txt_WIN_NET_ORACLE_ObjectInfo);
                            //CSFormat(txt_WIN_NET_ORACLE_Common);
                            //CSFormat(txt_WIN_NET_ORACLE_Note);
                        }
                    }
                }
                else if (gen_option.Substring(0, 1).Equals("2")) //JAVA
                {
                    if (gen_option.Substring(1, 1).Equals("1")) //SS
                    {
                        if (gen_option.Length == 3)
                        {
                            if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                            {
                                //WEB - JAVA - SS
                            }
                            else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                            {
                                //WIN - JAVA - SS
                            }
                        }
                        else if (gen_option.Length == 6) // WEB + WIN
                        {
                            //WEB and WIN - JAVA - SS
                        }
                    }
                    else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                    {
                        if (gen_option.Length == 3)
                        {
                            if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                            {
                                //WEB - JAVA - ORA
                            }
                            else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                            {
                                //WIN - JAVA - ORA
                            }
                        }
                        else if (gen_option.Length == 6) // WEB + WIN
                        {
                            //WEB and WIN - JAVA - SS
                        }
                    }
                }
            }
        }

        private void SetLanguageForRichBox()
        {
            string langNET = TIENITCodeGener.Properties.Settings.Default.NET_Language; //VB, CS

            if (langNET.Equals("VB")) //VB.NET
            {
                /***** Language ****/
                //WIN - .NET - SS
                txt_win_net_ss_DataProvider.Language = FastColoredTextBoxNS.Language.VB;
                txt_win_net_ss_Controller.Language = FastColoredTextBoxNS.Language.VB;
                txt_win_net_ss_ObjectInfo.Language = FastColoredTextBoxNS.Language.VB;
                txt_win_net_ss_Common.Language = FastColoredTextBoxNS.Language.VB;
                txt_win_net_ss_FormClass.Language = FastColoredTextBoxNS.Language.VB;
                txt_win_net_ss_Note.Language = FastColoredTextBoxNS.Language.VB;

                //WEB - .NET - SS (DNN)
                txt_web_net_ss_DataProvider.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_SQLDataProvider.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_ObjectInfo.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Controller.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Common.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_WebForm.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Note.Language = FastColoredTextBoxNS.Language.VB;

                //WEB - .NET - SS (NORMAL)
                txt_web_net_ss_DataProvider_NM.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Controller_NM.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_ObjectInfo_NM.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Common_NM.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_WebForm_NM.Language = FastColoredTextBoxNS.Language.VB;
                txt_web_net_ss_Note_NM.Language = FastColoredTextBoxNS.Language.VB;

                //WIN - .NET - ORA
                txt_WIN_NET_ORACLE_DAO.Language = FastColoredTextBoxNS.Language.VB;
                txt_WIN_NET_ORACLE_BO.Language = FastColoredTextBoxNS.Language.VB;
                txt_WIN_NET_ORACLE_ObjectInfo.Language = FastColoredTextBoxNS.Language.VB;
                txt_WIN_NET_ORACLE_Common.Language = FastColoredTextBoxNS.Language.VB;
                txt_WIN_NET_ORACLE_Note.Language = FastColoredTextBoxNS.Language.VB;

                //WEB - .NET - ORA
                txt_WEB_NET_ORACLE_DAO.Language = FastColoredTextBoxNS.Language.VB;
                txt_WEB_NET_ORACLE_BO.Language = FastColoredTextBoxNS.Language.VB;
                txt_WEB_NET_ORACLE_ObjectInfo.Language = FastColoredTextBoxNS.Language.VB;
                txt_WEB_NET_ORACLE_Common.Language = FastColoredTextBoxNS.Language.VB;
                txt_WEB_NET_ORACLE_WebForm.Language = FastColoredTextBoxNS.Language.VB;
                txt_WEB_NET_ORACLE_Note.Language = FastColoredTextBoxNS.Language.VB;

                /***** Prefix ****/
                //WIN - .NET - SS
                txt_win_net_ss_DataProvider.CommentPrefix = "'";
                txt_win_net_ss_Controller.CommentPrefix = "'";
                txt_win_net_ss_ObjectInfo.CommentPrefix = "'";
                txt_win_net_ss_Common.CommentPrefix = "'";
                txt_win_net_ss_FormClass.CommentPrefix = "'";
                txt_win_net_ss_Note.CommentPrefix = "'";

                //WEB - .NET - SS (DNN)
                txt_web_net_ss_DataProvider.CommentPrefix = "'";
                txt_web_net_ss_SQLDataProvider.CommentPrefix = "'";
                txt_web_net_ss_ObjectInfo.CommentPrefix = "'";
                txt_web_net_ss_Controller.CommentPrefix = "'";
                txt_web_net_ss_Common.CommentPrefix = "'";
                txt_web_net_ss_WebForm.CommentPrefix = "'";
                txt_web_net_ss_Note.CommentPrefix = "'";

                //WEB - .NET - SS (NORMAL)
                txt_web_net_ss_DataProvider_NM.CommentPrefix = "'";
                txt_web_net_ss_Controller_NM.CommentPrefix = "'";
                txt_web_net_ss_ObjectInfo_NM.CommentPrefix = "'";
                txt_web_net_ss_Common_NM.CommentPrefix = "'";
                txt_web_net_ss_WebForm_NM.CommentPrefix = "'";
                txt_web_net_ss_Note_NM.CommentPrefix = "'";

                //WIN - .NET - ORA
                txt_WIN_NET_ORACLE_DAO.CommentPrefix = "'";
                txt_WIN_NET_ORACLE_BO.CommentPrefix = "'";
                txt_WIN_NET_ORACLE_ObjectInfo.CommentPrefix = "'";
                txt_WIN_NET_ORACLE_Common.CommentPrefix = "'";
                txt_WIN_NET_ORACLE_Note.CommentPrefix = "'";

                //WEB - .NET - ORA
                txt_WEB_NET_ORACLE_DAO.CommentPrefix = "'";
                txt_WEB_NET_ORACLE_BO.CommentPrefix = "'";
                txt_WEB_NET_ORACLE_ObjectInfo.CommentPrefix = "'";
                txt_WEB_NET_ORACLE_Common.CommentPrefix = "'";
                txt_WEB_NET_ORACLE_WebForm.CommentPrefix = "'";
                txt_WEB_NET_ORACLE_Note.CommentPrefix = "'";
            }
            else if (langNET.Equals("CS")) //C#
            {
                /***** Language ****/
                //WIN - .NET - SS
                txt_win_net_ss_DataProvider.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_win_net_ss_Controller.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_win_net_ss_ObjectInfo.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_win_net_ss_Common.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_win_net_ss_FormClass.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_win_net_ss_Note.Language = FastColoredTextBoxNS.Language.CSharp;

                //WEB - .NET - SS (DNN)
                txt_web_net_ss_DataProvider.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_SQLDataProvider.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_ObjectInfo.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Controller.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Common.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_WebForm.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Note.Language = FastColoredTextBoxNS.Language.CSharp;

                //WEB - .NET - SS (NORMAL)
                txt_web_net_ss_DataProvider_NM.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Controller_NM.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_ObjectInfo_NM.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Common_NM.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_WebForm_NM.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_web_net_ss_Note_NM.Language = FastColoredTextBoxNS.Language.CSharp;

                //WIN - .NET - ORA
                txt_WIN_NET_ORACLE_DAO.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WIN_NET_ORACLE_BO.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WIN_NET_ORACLE_ObjectInfo.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WIN_NET_ORACLE_Common.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WIN_NET_ORACLE_Note.Language = FastColoredTextBoxNS.Language.CSharp;

                //WEB - .NET - ORA
                txt_WEB_NET_ORACLE_DAO.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WEB_NET_ORACLE_BO.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WEB_NET_ORACLE_ObjectInfo.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WEB_NET_ORACLE_Common.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WEB_NET_ORACLE_WebForm.Language = FastColoredTextBoxNS.Language.CSharp;
                txt_WEB_NET_ORACLE_Note.Language = FastColoredTextBoxNS.Language.CSharp;

                /***** Prefix ****/
                //WIN - .NET - SS
                txt_win_net_ss_DataProvider.CommentPrefix = "//";
                txt_win_net_ss_Controller.CommentPrefix = "//";
                txt_win_net_ss_ObjectInfo.CommentPrefix = "//";
                txt_win_net_ss_Common.CommentPrefix = "//";
                txt_win_net_ss_FormClass.CommentPrefix = "//";
                txt_win_net_ss_Note.CommentPrefix = "//";

                //WEB - .NET - SS (DNN)
                txt_web_net_ss_DataProvider.CommentPrefix = "//";
                txt_web_net_ss_SQLDataProvider.CommentPrefix = "//";
                txt_web_net_ss_ObjectInfo.CommentPrefix = "//";
                txt_web_net_ss_Controller.CommentPrefix = "//";
                txt_web_net_ss_Common.CommentPrefix = "//";
                txt_web_net_ss_WebForm.CommentPrefix = "//";
                txt_web_net_ss_Note.CommentPrefix = "//";

                //WEB - .NET - SS (NORMAL)
                txt_web_net_ss_DataProvider_NM.CommentPrefix = "//";
                txt_web_net_ss_Controller_NM.CommentPrefix = "//";
                txt_web_net_ss_ObjectInfo_NM.CommentPrefix = "//";
                txt_web_net_ss_Common_NM.CommentPrefix = "//";
                txt_web_net_ss_WebForm_NM.CommentPrefix = "//";
                txt_web_net_ss_Note_NM.CommentPrefix = "//";

                //WIN - .NET - ORA
                txt_WIN_NET_ORACLE_DAO.CommentPrefix = "//";
                txt_WIN_NET_ORACLE_BO.CommentPrefix = "//";
                txt_WIN_NET_ORACLE_ObjectInfo.CommentPrefix = "//";
                txt_WIN_NET_ORACLE_Common.CommentPrefix = "//";
                txt_WIN_NET_ORACLE_Note.CommentPrefix = "//";

                //WEB - .NET - ORA
                txt_WEB_NET_ORACLE_DAO.CommentPrefix = "//";
                txt_WEB_NET_ORACLE_BO.CommentPrefix = "//";
                txt_WEB_NET_ORACLE_ObjectInfo.CommentPrefix = "//";
                txt_WEB_NET_ORACLE_Common.CommentPrefix = "//";
                txt_WEB_NET_ORACLE_WebForm.CommentPrefix = "//";
                txt_WEB_NET_ORACLE_Note.CommentPrefix = "//";
            }
        }

        private void SetOptionForGen(string gen_option)
        {
            bool IsDNN = TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported;
            if (gen_option.Substring(0, 1).Equals("1")) //NET
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            xTabMain.TabPages.Clear();
                            if (IsDNN == true)
                            {
                                xTabMain.TabPages.Add(page_WEB_NET_SS);
                            }
                            else
                            {
                                xTabMain.TabPages.Add(page_WEB_NET_SS_NM);
                            }
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WIN_NET_SS);
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        xTabMain.TabPages.Clear();
                        if (IsDNN == true)
                        {
                            xTabMain.TabPages.Add(page_WEB_NET_SS);
                        }
                        else
                        {
                            xTabMain.TabPages.Add(page_WEB_NET_SS_NM);
                        }
                        xTabMain.TabPages.Add(page_WIN_NET_SS);
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WEB_NET_ORA);
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WIN_NET_ORA);
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        xTabMain.TabPages.Clear();
                        xTabMain.TabPages.Add(page_WEB_NET_ORA);
                        xTabMain.TabPages.Add(page_WIN_NET_ORA);
                    }
                }
            }
            else if (gen_option.Substring(0, 1).Equals("2")) //JAVA
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WEB_JAVA_SS);
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WIN_JAVA_SS);
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        xTabMain.TabPages.Clear();
                        xTabMain.TabPages.Add(page_WEB_JAVA_SS);
                        xTabMain.TabPages.Add(page_WIN_JAVA_SS);
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WEB_JAVA_ORA);
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            xTabMain.TabPages.Clear();
                            xTabMain.TabPages.Add(page_WIN_JAVA_ORA);
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        xTabMain.TabPages.Clear();
                        xTabMain.TabPages.Add(page_WEB_JAVA_ORA);
                        xTabMain.TabPages.Add(page_WIN_JAVA_ORA);
                    }
                }
            }
        }
#endregion

#region "Bind Data to Control"
        private void tvTable_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (HaveCheckedNode())
            {
                pn_BOUND_TOP.Visible = true;
                if (TIENITCodeGener.Properties.Settings.Default.Mode_App.Equals("FULL"))
                {
                    btnGen.Enabled = true;
                }
                else if (TIENITCodeGener.Properties.Settings.Default.Mode_App.Equals("FREE"))
                {
                    btnGen.Enabled = false;
                }
            }
            else
            {
                pn_BOUND_TOP.Visible = false;
            }
        }

        private bool HaveCheckedNode()
        {
            int count = 0;
            for (int i = 0; i < tvTable.Nodes.Count; i++)
            {
                if (tvTable.Nodes[i].Checked == true)
                {
                    count = count + 1;
                }
            }
            if (count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        private void SelectAllNode(bool bSelect)
        {
            try
            {
                foreach (TreeNode cNode in tvTable.Nodes)
                {
                    cNode.Checked = bSelect;
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void tvTable_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                if (tvTable.Nodes.Count > 0)
                {
                    string gen_option = TIENITCodeGener.Properties.Settings.Default.Option_For_Gen_Code;
                    TreeNode nodeTable = tvTable.SelectedNode;
                    string tableId = nodeTable.Tag.ToString();
                    string tableName = nodeTable.Text;
                    string tableClassPrefix = CommonFunction.FormatName(tableName);
                    CommonInfo.Oracle_TableClassPrefix = tableClassPrefix;
                    string packageName = tableName.ToUpper() + "_PKG";
                    CommonInfo.Oracle_Package_Name = packageName;
                    if (tableId != null || !tableId.Equals(""))
                    {
                        if (gen_option.Substring(1, 1).Equals("1")) // SS
                        {
                            string strSQL = "";
                            strSQL = strSQL + "SELECT syscolumns.name AS keyname, systypes.name AS keyvalue, syscolumns.typestat as tablekey, syscolumns.colstat as identitys, syscolumns.Length";
                            strSQL = strSQL + " FROM sysobjects, syscolumns, systypes ";
                            strSQL = strSQL + " WHERE sysobjects.id = syscolumns.id AND ";
                            strSQL = strSQL + " syscolumns.xtype = systypes.xtype AND ";
                            strSQL = strSQL + " sysobjects.name = '" + tableName + "' AND ";
                            strSQL = strSQL + " systypes.name<>'sysname'";
                            strSQL = strSQL + " ORDER BY syscolumns.colid";
                            IDataReader reader;
                            DataTypeSQLServer dtTemp;
                            ColumnInfo colInfo;
                            reader = SqlHelper.ExecuteReader(CommonInfo.ConnectionString, CommandType.Text, strSQL);
                            CommonInfo.arr.Clear();
                            //Tim kiem list PK, sau do check su ton tai cua dtTemp.datakey trong list PK
                            //string primaryKey = CommonFunction.GetPrimaryKey(tableName, CommonInfo.ConnectionString);
                            List<DataKeyInfo> listPK = CommonFunction.GetListPrimaryKey(tableName, CommonInfo.ConnectionString);
                            LST_COL_INFO = new List<ColumnInfo>();
                            while (reader.Read())
                            {
                                colInfo = new ColumnInfo();
                                dtTemp = new DataTypeSQLServer();
                                dtTemp.datakey = reader["keyname"].ToString(); colInfo.COLUMN_NAME = dtTemp.datakey;
                                dtTemp.datatype = reader["keyvalue"].ToString(); colInfo.DATA_TYPE = dtTemp.datatype;
                                dtTemp.tablekey = 0;
                                //if (dtTemp.datakey.Equals(primaryKey))
                                //{
                                //    dtTemp.tablekey = 1;
                                //}
                                if (CheckExistItemInList(listPK, dtTemp.datakey))
                                {
                                    dtTemp.tablekey = 1;
                                }
                                colInfo.IS_PK = dtTemp.tablekey;
                                dtTemp.identitys = Convert.ToInt32(reader["identitys"].ToString()); colInfo.IS_IDEN = dtTemp.identitys;
                                dtTemp.datalength = Convert.ToInt32(reader["Length"].ToString()) / 2; colInfo.DATA_LENGTH = dtTemp.datalength;
                                CommonInfo.arr.Add(dtTemp); LST_COL_INFO.Add(colInfo);
                            }
                            //Su dung luon listPK de check xem co Primary Key hay khong !
                            //Binh thuong, chung ta su dung ham CheckTableHasPrimaryKey("SS", CommonInfo.arr);
                            if (listPK.Count > 0)
                            {
                                SetDataToControl(gen_option, tableName);
                                SetFormatCodeForCSharp();
                            }
                            else
                            {
                                SetNothingToControl(gen_option);
                            }
                        }
                        else if (gen_option.Substring(1, 1).Equals("2")) // ORA
                        {
                            string strSQL = "";
                            strSQL = strSQL + "SELECT COLUMN_NAME keyname,DATA_TYPE keyvalue,DATA_LENGTH Length,";
                            strSQL = strSQL + " (SELECT 'P' FROM user_cons_columns a, user_constraints b ";
                            strSQL = strSQL + " WHERE a.table_name='" + tableName + "' ";
                            strSQL = strSQL + " AND b.constraint_type = 'P' ";
                            strSQL = strSQL + " AND a.constraint_name = b.constraint_name ";
                            strSQL = strSQL + " AND a.owner = b.owner ";
                            strSQL = strSQL + " AND a.column_name = x.column_name) tablekey ";
                            strSQL = strSQL + " FROM COLS x WHERE Table_Name like '" + tableName + "' ";
                            strSQL = strSQL + " ORDER BY column_id";
                            IDataReader readerOracle;
                            DataTypeOracle dtTempOracle;
                            ColumnInfo colInfo;
                            readerOracle = OracleHelper.ExecuteReader(CommonInfo.ConnectionStringOracle, CommandType.Text, strSQL);
                            CommonInfo.arr.Clear();
                            bool bCheckOraHasPrimaryKey = false;
                            LST_COL_INFO = new List<ColumnInfo>();
                            while (readerOracle.Read())
                            {
                                colInfo = new ColumnInfo();
                                dtTempOracle = new DataTypeOracle();
                                dtTempOracle.datakey = readerOracle["keyname"].ToString(); colInfo.COLUMN_NAME = dtTempOracle.datakey;
                                dtTempOracle.datatype = readerOracle["keyvalue"].ToString(); colInfo.DATA_TYPE = dtTempOracle.datatype;
                                dtTempOracle.datalength = Convert.ToInt32(readerOracle["Length"].ToString()) / 2; colInfo.DATA_LENGTH = dtTempOracle.datalength;
                                dtTempOracle.tablekey = Interaction.IIf(Information.IsDBNull(readerOracle["tablekey"]), "", readerOracle["tablekey"]).ToString();
                                colInfo.IS_IDEN = 0;
                                if (dtTempOracle.tablekey.Equals("P"))
                                {
                                    colInfo.IS_PK = 1;
                                }
                                else
                                {
                                    colInfo.IS_PK = 0;
                                }
                                CommonInfo.arr.Add(dtTempOracle); LST_COL_INFO.Add(colInfo);
                                bCheckOraHasPrimaryKey = CheckTableHasPrimaryKey("ORA", CommonInfo.arr);
                            }
                            if (bCheckOraHasPrimaryKey == true)
                            {
                                SetDataToControl(gen_option, tableName);
                                SetFormatCodeForCSharp();
                            }
                            else
                            {
                                SetNothingToControl(gen_option);
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private bool CheckExistItemInList(List<DataKeyInfo> listPK, string itemPK)
        {
            bool bCheck = false;
            foreach (DataKeyInfo dtInfo in listPK)
            {
                if (dtInfo.COLUMN_NAME.Equals(itemPK))
                {
                    bCheck = true;
                    break;
                }
            }
            return bCheck;
        }

        private bool CheckTableHasPrimaryKey(string DBMS, ArrayList arrCol)
        {
            bool bPK = false;
            if (DBMS.Equals("SS"))
            {
                for (int i = 0; i < arrCol.Count; i++)
                {
                    if (((DataTypeSQLServer)arrCol[i]).tablekey == 1)
                    {
                        bPK = true;
                        break;
                    }
                }
            }
            else if (DBMS.Equals("ORA"))
            {
                for (int i = 0; i < arrCol.Count; i++)
                {
                    if (((DataTypeOracle)arrCol[i]).tablekey == "P")
                    {
                        bPK = true;
                        break;
                    }
                }
            }
            return bPK;
        }

        private void SetDataToControl(string gen_option, string tableName)
        {
            bool IsDNN = TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported;
            string langNET = TIENITCodeGener.Properties.Settings.Default.NET_Language;

            if (gen_option.Substring(0, 1).Equals("1")) //NET
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - NET - SS
                            if (IsDNN == true)
                            {
                                if (langNET.Equals("VB")) //VB.NET
                                {
                                    txt_web_net_ss_DataProvider.Text = CommonFunction.web_net_ss_GenDataProvider(tableName, CommonInfo.arr);
                                    txt_web_net_ss_SQLDataProvider.Text = CommonFunction.web_net_ss_GenSQLDataProvider(tableName, CommonInfo.arr);
                                    txt_web_net_ss_ObjectInfo.Text = CommonFunction.web_net_ss_GenInfoClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Controller.Text = CommonFunction.web_net_ss_GenControllerClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Common.Text = CommonFunction.web_net_ss_GenDataProviderCommon();
                                    txt_web_net_ss_Stored.Text = CommonFunction.web_net_ss_GenSQLStore(tableName, CommonInfo.arr);
                                    txt_web_net_ss_WebForm.Text = CommonFunction.web_net_ss_GenFormClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Note.Text = CommonFunction.web_net_ss_GenNote();
                                }
                                else //C#
                                {
                                    txt_web_net_ss_DataProvider.Text = CommonFunction.web_net_ss_GenDataProvider_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_SQLDataProvider.Text = CommonFunction.web_net_ss_GenSQLDataProvider_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_ObjectInfo.Text = CommonFunction.web_net_ss_GenInfoClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Controller.Text = CommonFunction.web_net_ss_GenControllerClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Common.Text = CommonFunction.web_net_ss_GenDataProviderCommon_CS();
                                    txt_web_net_ss_Stored.Text = CommonFunction.web_net_ss_GenSQLStore_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_WebForm.Text = CommonFunction.web_net_ss_GenFormClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Note.Text = CommonFunction.web_net_ss_GenNote_CS();
                                }
                            }
                            else
                            {
                                if (langNET.Equals("VB")) //VB.NET
                                {
                                    txt_web_net_ss_DataProvider_NM.Text = CommonFunction.web_net_ss_normal_GenDataProvider(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Controller_NM.Text = CommonFunction.web_net_ss_normal_GenControllerClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_ObjectInfo_NM.Text = CommonFunction.web_net_ss_normal_GenInfoClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Common_NM.Text = CommonFunction.web_net_ss_normal_GenDataProviderCommon();
                                    txt_web_net_ss_Stored_NM.Text = CommonFunction.web_net_ss_normal_GenSQLStore(tableName, CommonInfo.arr);
                                    txt_web_net_ss_WebForm_NM.Text = CommonFunction.web_net_ss_normal_GenFormClass(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Note_NM.Text = CommonFunction.web_net_ss_normal_GenNote();
                                }
                                else //C#
                                {
                                    txt_web_net_ss_DataProvider_NM.Text = CommonFunction.web_net_ss_normal_GenDataProvider_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Controller_NM.Text = CommonFunction.web_net_ss_normal_GenControllerClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_ObjectInfo_NM.Text = CommonFunction.web_net_ss_normal_GenInfoClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Common_NM.Text = CommonFunction.web_net_ss_normal_GenDataProviderCommon_CS();
                                    txt_web_net_ss_Stored_NM.Text = CommonFunction.web_net_ss_normal_GenSQLStore_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_WebForm_NM.Text = CommonFunction.web_net_ss_normal_GenFormClass_CS(tableName, CommonInfo.arr);
                                    txt_web_net_ss_Note_NM.Text = CommonFunction.web_net_ss_normal_GenNote_CS();
                                }
                            }
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - NET - SS
                            if (langNET.Equals("VB")) //VB.NET
                            {
                                txt_win_net_ss_DataProvider.Text = CommonFunction.win_net_ss_GenDataProvider(tableName, CommonInfo.arr);
                                txt_win_net_ss_Controller.Text = CommonFunction.win_net_ss_GenControllerClass(tableName, CommonInfo.arr);
                                txt_win_net_ss_ObjectInfo.Text = CommonFunction.win_net_ss_GenInfoClass(tableName, CommonInfo.arr);
                                txt_win_net_ss_Common.Text = CommonFunction.win_net_ss_GenDataProviderCommon();
                                txt_win_net_ss_Stored.Text = CommonFunction.win_net_ss_GenSQLStore(tableName, CommonInfo.arr);
                                txt_win_net_ss_FormClass.Text = CommonFunction.win_net_ss_GenFormClass(tableName, CommonInfo.arr);
                                txt_win_net_ss_Note.Text = CommonFunction.win_net_ss_GenNote();
                            }
                            else //C#
                            {
                                txt_win_net_ss_DataProvider.Text = CommonFunction.win_net_ss_GenDataProvider_CS(tableName, CommonInfo.arr);
                                txt_win_net_ss_Controller.Text = CommonFunction.win_net_ss_GenControllerClass_CS(tableName, CommonInfo.arr);
                                txt_win_net_ss_ObjectInfo.Text = CommonFunction.win_net_ss_GenInfoClass_CS(tableName, CommonInfo.arr);
                                txt_win_net_ss_Common.Text = CommonFunction.win_net_ss_GenDataProviderCommon_CS();
                                txt_win_net_ss_Stored.Text = CommonFunction.win_net_ss_GenSQLStore_CS(tableName, CommonInfo.arr);
                                txt_win_net_ss_FormClass.Text = CommonFunction.win_net_ss_GenFormClass_CS(tableName, CommonInfo.arr);
                                txt_win_net_ss_Note.Text = CommonFunction.win_net_ss_GenNote_CS();
                            }                           
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - NET - SS
                        if (IsDNN == true)
                        {
                            if (langNET.Equals("VB")) //VB.NET
                            {
                                txt_web_net_ss_DataProvider.Text = CommonFunction.web_net_ss_GenDataProvider(tableName, CommonInfo.arr);
                                txt_web_net_ss_SQLDataProvider.Text = CommonFunction.web_net_ss_GenSQLDataProvider(tableName, CommonInfo.arr);
                                txt_web_net_ss_ObjectInfo.Text = CommonFunction.web_net_ss_GenInfoClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_Controller.Text = CommonFunction.web_net_ss_GenControllerClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_Common.Text = CommonFunction.web_net_ss_GenDataProviderCommon();
                                txt_web_net_ss_Stored.Text = CommonFunction.web_net_ss_GenSQLStore(tableName, CommonInfo.arr);
                                txt_web_net_ss_WebForm.Text = CommonFunction.web_net_ss_GenFormClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_Note.Text = CommonFunction.web_net_ss_GenNote();
                            }
                            else //C#
                            {
                                txt_web_net_ss_DataProvider.Text = CommonFunction.web_net_ss_GenDataProvider_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_SQLDataProvider.Text = CommonFunction.web_net_ss_GenSQLDataProvider_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_ObjectInfo.Text = CommonFunction.web_net_ss_GenInfoClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Controller.Text = CommonFunction.web_net_ss_GenControllerClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Common.Text = CommonFunction.web_net_ss_GenDataProviderCommon_CS();
                                txt_web_net_ss_Stored.Text = CommonFunction.web_net_ss_GenSQLStore_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_WebForm.Text = CommonFunction.web_net_ss_GenFormClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Note.Text = CommonFunction.web_net_ss_GenNote_CS();
                            }
                        }
                        else
                        {
                            if (langNET.Equals("VB")) //VB.NET
                            {
                                txt_web_net_ss_DataProvider_NM.Text = CommonFunction.web_net_ss_normal_GenDataProvider(tableName, CommonInfo.arr);
                                txt_web_net_ss_Controller_NM.Text = CommonFunction.web_net_ss_normal_GenControllerClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_ObjectInfo_NM.Text = CommonFunction.web_net_ss_normal_GenInfoClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_Common_NM.Text = CommonFunction.web_net_ss_normal_GenDataProviderCommon();
                                txt_web_net_ss_Stored_NM.Text = CommonFunction.web_net_ss_normal_GenSQLStore(tableName, CommonInfo.arr);
                                txt_web_net_ss_WebForm_NM.Text = CommonFunction.web_net_ss_normal_GenFormClass(tableName, CommonInfo.arr);
                                txt_web_net_ss_Note_NM.Text = CommonFunction.web_net_ss_normal_GenNote();
                            }
                            else //C#
                            {
                                txt_web_net_ss_DataProvider_NM.Text = CommonFunction.web_net_ss_normal_GenDataProvider_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Controller_NM.Text = CommonFunction.web_net_ss_normal_GenControllerClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_ObjectInfo_NM.Text = CommonFunction.web_net_ss_normal_GenInfoClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Common_NM.Text = CommonFunction.web_net_ss_normal_GenDataProviderCommon_CS();
                                txt_web_net_ss_Stored_NM.Text = CommonFunction.web_net_ss_normal_GenSQLStore_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_WebForm_NM.Text = CommonFunction.web_net_ss_normal_GenFormClass_CS(tableName, CommonInfo.arr);
                                txt_web_net_ss_Note_NM.Text = CommonFunction.web_net_ss_normal_GenNote_CS();
                            }
                        }
                        //WIN
                        if (langNET.Equals("VB")) //VB.NET
                        {
                            txt_win_net_ss_DataProvider.Text = CommonFunction.win_net_ss_GenDataProvider(tableName, CommonInfo.arr);
                            txt_win_net_ss_Controller.Text = CommonFunction.win_net_ss_GenControllerClass(tableName, CommonInfo.arr);
                            txt_win_net_ss_ObjectInfo.Text = CommonFunction.win_net_ss_GenInfoClass(tableName, CommonInfo.arr);
                            txt_win_net_ss_Common.Text = CommonFunction.win_net_ss_GenDataProviderCommon();
                            txt_win_net_ss_Stored.Text = CommonFunction.win_net_ss_GenSQLStore(tableName, CommonInfo.arr);
                            txt_win_net_ss_FormClass.Text = CommonFunction.win_net_ss_GenFormClass(tableName, CommonInfo.arr);
                            txt_win_net_ss_Note.Text = CommonFunction.win_net_ss_GenNote();
                        }
                        else //C#
                        {
                            txt_win_net_ss_DataProvider.Text = CommonFunction.win_net_ss_GenDataProvider_CS(tableName, CommonInfo.arr);
                            txt_win_net_ss_Controller.Text = CommonFunction.win_net_ss_GenControllerClass_CS(tableName, CommonInfo.arr);
                            txt_win_net_ss_ObjectInfo.Text = CommonFunction.win_net_ss_GenInfoClass_CS(tableName, CommonInfo.arr);
                            txt_win_net_ss_Common.Text = CommonFunction.win_net_ss_GenDataProviderCommon_CS();
                            txt_win_net_ss_Stored.Text = CommonFunction.win_net_ss_GenSQLStore_CS(tableName, CommonInfo.arr);
                            txt_win_net_ss_FormClass.Text = CommonFunction.win_net_ss_GenFormClass_CS(tableName, CommonInfo.arr);
                            txt_win_net_ss_Note.Text = CommonFunction.win_net_ss_GenNote_CS();
                        }
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - NET - ORA
                            if (langNET.Equals("VB")) //VB.NET
                            {
                                txt_WEB_NET_ORACLE_SqlScript.Text = CommonFunction.web_net_ora_GenSQLStore(tableName, CommonInfo.arr);
                                txt_WEB_NET_ORACLE_DAO.Text = CommonFunction.web_net_ora_GenDataAccess(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_BO.Text = CommonFunction.web_net_ora_GenBusinessObject(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonFunction.web_net_ora_GenInfoClass(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_WebForm.Text = CommonFunction.web_net_ora_GenFormClass(tableName, CommonInfo.arr);
                                txt_WEB_NET_ORACLE_Common.Text = CommonFunction.web_net_ora_GenCommon();
                                txt_WEB_NET_ORACLE_Note.Text = CommonFunction.web_net_ora_GenNote();
                            }
                            else //C#
                            {
                                txt_WEB_NET_ORACLE_SqlScript.Text = CommonFunction.web_net_ora_GenSQLStore_CS(tableName, CommonInfo.arr);
                                txt_WEB_NET_ORACLE_DAO.Text = CommonFunction.web_net_ora_GenDataAccess_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_BO.Text = CommonFunction.web_net_ora_GenBusinessObject_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonFunction.web_net_ora_GenInfoClass_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WEB_NET_ORACLE_WebForm.Text = CommonFunction.web_net_ora_GenFormClass_CS(tableName, CommonInfo.arr);
                                txt_WEB_NET_ORACLE_Common.Text = CommonFunction.web_net_ora_GenCommon_CS();
                                txt_WEB_NET_ORACLE_Note.Text = CommonFunction.web_net_ora_GenNote_CS();
                            }                          
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - NET - ORA
                            if (langNET.Equals("VB")) //VB.NET
                            {
                                txt_WIN_NET_ORACLE_SqlScript.Text = CommonFunction.win_net_ora_GenSQLStore(tableName, CommonInfo.arr);
                                txt_WIN_NET_ORACLE_DAO.Text = CommonFunction.win_net_ora_GenDataAccess(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_BO.Text = CommonFunction.win_net_ora_GenBusinessObject(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonFunction.win_net_ora_GenInfoClass(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_Common.Text = CommonFunction.win_net_ora_GenCommon();
                                txt_WIN_NET_ORACLE_Note.Text = CommonFunction.win_net_ora_GenNote();
                            }
                            else //C#
                            {
                                txt_WIN_NET_ORACLE_SqlScript.Text = CommonFunction.win_net_ora_GenSQLStore_CS(tableName, CommonInfo.arr);
                                txt_WIN_NET_ORACLE_DAO.Text = CommonFunction.win_net_ora_GenDataAccess_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_BO.Text = CommonFunction.win_net_ora_GenBusinessObject_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonFunction.win_net_ora_GenInfoClass_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                                txt_WIN_NET_ORACLE_Common.Text = CommonFunction.win_net_ora_GenCommon_CS();
                                txt_WIN_NET_ORACLE_Note.Text = CommonFunction.win_net_ora_GenNote_CS();
                            }
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - NET - ORA
                        if (langNET.Equals("VB")) //VB.NET
                        {
                            txt_WEB_NET_ORACLE_SqlScript.Text = CommonFunction.web_net_ora_GenSQLStore(tableName, CommonInfo.arr);
                            txt_WEB_NET_ORACLE_DAO.Text = CommonFunction.web_net_ora_GenDataAccess(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_BO.Text = CommonFunction.web_net_ora_GenBusinessObject(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonFunction.web_net_ora_GenInfoClass(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_WebForm.Text = CommonFunction.web_net_ora_GenFormClass(tableName, CommonInfo.arr);
                            txt_WEB_NET_ORACLE_Common.Text = CommonFunction.web_net_ora_GenCommon();
                            txt_WEB_NET_ORACLE_Note.Text = CommonFunction.web_net_ora_GenNote();
                            //
                            txt_WIN_NET_ORACLE_SqlScript.Text = CommonFunction.win_net_ora_GenSQLStore(tableName, CommonInfo.arr);
                            txt_WIN_NET_ORACLE_DAO.Text = CommonFunction.win_net_ora_GenDataAccess(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_BO.Text = CommonFunction.win_net_ora_GenBusinessObject(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonFunction.win_net_ora_GenInfoClass(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_Common.Text = CommonFunction.win_net_ora_GenCommon();
                            txt_WIN_NET_ORACLE_Note.Text = CommonFunction.win_net_ora_GenNote();
                        }
                        else //C#
                        {
                            txt_WEB_NET_ORACLE_SqlScript.Text = CommonFunction.web_net_ora_GenSQLStore_CS(tableName, CommonInfo.arr);
                            txt_WEB_NET_ORACLE_DAO.Text = CommonFunction.web_net_ora_GenDataAccess_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_BO.Text = CommonFunction.web_net_ora_GenBusinessObject_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonFunction.web_net_ora_GenInfoClass_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WEB_NET_ORACLE_WebForm.Text = CommonFunction.web_net_ora_GenFormClass_CS(tableName, CommonInfo.arr);
                            txt_WEB_NET_ORACLE_Common.Text = CommonFunction.web_net_ora_GenCommon_CS();
                            txt_WEB_NET_ORACLE_Note.Text = CommonFunction.web_net_ora_GenNote_CS();
                            //
                            txt_WIN_NET_ORACLE_SqlScript.Text = CommonFunction.win_net_ora_GenSQLStore_CS(tableName, CommonInfo.arr);
                            txt_WIN_NET_ORACLE_DAO.Text = CommonFunction.win_net_ora_GenDataAccess_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_BO.Text = CommonFunction.win_net_ora_GenBusinessObject_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonFunction.win_net_ora_GenInfoClass_CS(tableName, CommonInfo.arr, CommonInfo.Oracle_TableClassPrefix);
                            txt_WIN_NET_ORACLE_Common.Text = CommonFunction.win_net_ora_GenCommon_CS();
                            txt_WIN_NET_ORACLE_Note.Text = CommonFunction.win_net_ora_GenNote_CS();
                        }
                    }
                }
            }
            else if (gen_option.Substring(0, 1).Equals("2")) //JAVA
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - JAVA - SS
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - JAVA - SS
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - JAVA - SS
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - JAVA - ORA
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - JAVA - ORA
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - JAVA - SS
                    }
                }
            }
        }

        private void SetNothingToControl(string gen_option)
        {
            bool IsDNN = TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported;
            if (gen_option.Substring(0, 1).Equals("1")) //NET
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - NET - SS
                            if (IsDNN == true)
                            {
                                txt_web_net_ss_DataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_SQLDataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Controller.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Common.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Stored.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_WebForm.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Note.Text = CommonInfo.sTableNoPrimaryKey;
                            }
                            else
                            {
                                txt_web_net_ss_DataProvider_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Controller_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_ObjectInfo_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Common_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Stored_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_WebForm_NM.Text = CommonInfo.sTableNoPrimaryKey;
                                txt_web_net_ss_Note_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            }
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - NET - SS
                            txt_win_net_ss_DataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_Controller.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_Common.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_Stored.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_FormClass.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_win_net_ss_Note.Text = CommonInfo.sTableNoPrimaryKey;
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - NET - SS
                        if (IsDNN == true)
                        {
                            txt_web_net_ss_DataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_SQLDataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Controller.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Common.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Stored.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_WebForm.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Note.Text = CommonInfo.sTableNoPrimaryKey;
                        }
                        else
                        {
                            txt_web_net_ss_DataProvider_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Controller_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_ObjectInfo_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Common_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Stored_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_WebForm_NM.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_web_net_ss_Note_NM.Text = CommonInfo.sTableNoPrimaryKey;
                        }
                        //
                        txt_win_net_ss_DataProvider.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_Controller.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_Common.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_Stored.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_FormClass.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_win_net_ss_Note.Text = CommonInfo.sTableNoPrimaryKey;
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - NET - ORA
                            txt_WEB_NET_ORACLE_SqlScript.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_DAO.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_BO.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_WebForm.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_Common.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WEB_NET_ORACLE_Note.Text = CommonInfo.sTableNoPrimaryKey;
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - NET - ORA
                            txt_WIN_NET_ORACLE_SqlScript.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WIN_NET_ORACLE_DAO.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WIN_NET_ORACLE_BO.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WIN_NET_ORACLE_Common.Text = CommonInfo.sTableNoPrimaryKey;
                            txt_WIN_NET_ORACLE_Note.Text = CommonInfo.sTableNoPrimaryKey;
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - NET - ORA
                        txt_WEB_NET_ORACLE_SqlScript.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_DAO.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_BO.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_WebForm.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_Common.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WEB_NET_ORACLE_Note.Text = CommonInfo.sTableNoPrimaryKey;
                        //
                        txt_WIN_NET_ORACLE_SqlScript.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WIN_NET_ORACLE_DAO.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WIN_NET_ORACLE_BO.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WIN_NET_ORACLE_ObjectInfo.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WIN_NET_ORACLE_Common.Text = CommonInfo.sTableNoPrimaryKey;
                        txt_WIN_NET_ORACLE_Note.Text = CommonInfo.sTableNoPrimaryKey;
                    }
                }
            }
            else if (gen_option.Substring(0, 1).Equals("2")) //JAVA
            {
                if (gen_option.Substring(1, 1).Equals("1")) //SS
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - JAVA - SS
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - JAVA - SS
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - JAVA - SS
                    }
                }
                else if (gen_option.Substring(1, 1).Equals("2")) //ORA
                {
                    if (gen_option.Length == 3)
                    {
                        if (Strings.Right(gen_option, 1).Equals("1")) //WEB
                        {
                            //WEB - JAVA - ORA
                        }
                        else if (Strings.Right(gen_option, 1).Equals("2")) //WIN
                        {
                            //WIN - JAVA - ORA
                        }
                    }
                    else if (gen_option.Length == 6) // WEB + WIN
                    {
                        //WEB and WIN - JAVA - SS
                    }
                }
            }
        }
#endregion

#region "ToolStrip Menu"
        private void toolStripMenu_SelectAll_Click(object sender, EventArgs e)
        {
            SelectAllNode(true);
            pn_BOUND_TOP.Visible = true;
        }

        private void toolStripMenu_DeselectAll_Click(object sender, EventArgs e)
        {
            SelectAllNode(false);
            pn_BOUND_TOP.Visible = false;
        }

        private void toolStripMenu_ColDetail_Click(object sender, EventArgs e)
        {
            frmCols m_Frm = new frmCols();
            //m_Frm.Text = "TABLE - " + tvTable.SelectedNode.Text;
            m_Frm.LIST_DATA = LST_COL_INFO;
            m_Frm.ShowDialog();
        }
#endregion

#region "Do Gen Code"
        private List<String> GetTableClassName()
        {
            LST_CLASS_NAME = new List<String>();
            try
            {
                foreach (TreeNode cNode in tvTable.Nodes)
                {
                    if (cNode.Checked)
                    {
                        LST_CLASS_NAME.Add(cNode.Text);
                    }
                }
            }
            catch
            {
            }

            return LST_CLASS_NAME;
        }

        private void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            DO_GEN_OPTION();
        }

        private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            int value_progress = (int)e.ProgressPercentage;
            m_Frm_Loading.lbl_Percent_Value.Text = value_progress.ToString();
        }

        private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            m_Frm_Loading.Close();
            ITFACommon.Message_Information("Completed !");
        }

        private string GetTableClassFromTableName(string tableName)
        {
            string tablePrefix = CommonFunction.GetTablePrefixOriginal(tableName);
            string tableClass = CommonFunction.RemoveS(tablePrefix);
            tableClass = tableClass.Replace("_", "");
            return tableClass;
        }

        private ArrayList GET_LIST_COLUMN_SQLSERVER(string tableClassName)
        {
            ArrayList arr_col = new ArrayList();
            string strSQL = "";
            strSQL = strSQL + "SELECT syscolumns.name AS keyname, systypes.name AS keyvalue, syscolumns.typestat as tablekey, syscolumns.colstat as identitys, syscolumns.Length";
            strSQL = strSQL + " FROM sysobjects, syscolumns, systypes ";
            strSQL = strSQL + " WHERE sysobjects.id = syscolumns.id AND ";
            strSQL = strSQL + " syscolumns.xtype = systypes.xtype AND ";
            strSQL = strSQL + " sysobjects.name = '" + tableClassName + "' AND ";
            strSQL = strSQL + " systypes.name<>'sysname'";
            strSQL = strSQL + " ORDER BY syscolumns.colid";
            IDataReader reader;
            DataTypeSQLServer dtTemp;
            reader = SqlHelper.ExecuteReader(CommonInfo.ConnectionString, CommandType.Text, strSQL);
            arr_col.Clear();
            string primaryKey = CommonFunction.GetPrimaryKey(tableClassName, CommonInfo.ConnectionString);
            while (reader.Read())
            {
                dtTemp = new DataTypeSQLServer();
                dtTemp.datakey = reader["keyname"].ToString();
                dtTemp.datatype = reader["keyvalue"].ToString();
                dtTemp.tablekey = 0;
                if (dtTemp.datakey.Equals(primaryKey))
                {
                    dtTemp.tablekey = 1;
                }
                dtTemp.identitys = Convert.ToInt32(reader["identitys"].ToString());
                dtTemp.datalength = Convert.ToInt32(reader["Length"].ToString()) / 2;
                arr_col.Add(dtTemp);
            }
            return arr_col;
        }

        private ArrayList GET_LIST_COLUMN_ORACLE(string tableClassName)
        {
            ArrayList arr_col = new ArrayList();
            string strSQL = "";
            strSQL = strSQL + "SELECT COLUMN_NAME keyname,DATA_TYPE keyvalue,DATA_LENGTH Length,";
            strSQL = strSQL + " (SELECT 'P' FROM user_cons_columns a, user_constraints b ";
            strSQL = strSQL + " WHERE a.table_name='" + tableClassName + "' ";
            strSQL = strSQL + " AND b.constraint_type = 'P' ";
            strSQL = strSQL + " AND a.constraint_name = b.constraint_name ";
            strSQL = strSQL + " AND a.owner = b.owner ";
            strSQL = strSQL + " AND a.column_name = x.column_name) tablekey ";
            strSQL = strSQL + " FROM COLS x WHERE Table_Name like '" + tableClassName + "' ";
            strSQL = strSQL + " ORDER BY column_id";
            IDataReader readerOracle;
            DataTypeOracle dtTempOracle;
            readerOracle = OracleHelper.ExecuteReader(CommonInfo.ConnectionStringOracle, CommandType.Text, strSQL);
            arr_col.Clear();
            while (readerOracle.Read())
            {
                dtTempOracle = new DataTypeOracle();
                dtTempOracle.datakey = readerOracle["keyname"].ToString();
                dtTempOracle.datatype = readerOracle["keyvalue"].ToString();
                dtTempOracle.datalength = Convert.ToInt32(readerOracle["Length"].ToString()) / 2;
                dtTempOracle.tablekey = Interaction.IIf(Information.IsDBNull(readerOracle["tablekey"]), "", readerOracle["tablekey"]).ToString();
                arr_col.Add(dtTempOracle);
            }
            return arr_col;
        }

        //Do Gen
        private void DO_GEN_OPTION()
        {
            string langNET = TIENITCodeGener.Properties.Settings.Default.NET_Language;

            if (langNET.Equals("VB")) //VB.NET
            {
                if (NET_OR_JAVA == 1) //.NET
                {
                    if (SS_OR_ORA == 1) //SS
                    {
                        if (WEB_OR_WIN == 1) //web
                        {
                            if (TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported)
                            {
                                DoSaveOption_WEB_NET_SS();
                            }
                            else
                            {
                                DoSaveOption_WEB_NET_SS_NORMAL();
                            }
                        }
                        else if (WEB_OR_WIN == 2) //win
                        {
                            DoSaveOption_WIN_NET_SS();
                        }
                        else if (WEB_OR_WIN == 3) //web and win
                        {
                            if (TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported)
                            {
                                DoSaveOption_WEB_AND_WIN_NET_SS();
                            }
                            else
                            {
                                DoSaveOption_WEB_AND_WIN_NET_SS_NORMAL();
                            }
                        }
                    }
                    else if (SS_OR_ORA == 2) //ORA
                    {
                        if (WEB_OR_WIN == 1) //web
                        {
                            DoSaveOption_WEB_NET_ORA();
                        }
                        else if (WEB_OR_WIN == 2) //win
                        {
                            DoSaveOption_WIN_NET_ORA();
                        }
                        else if (WEB_OR_WIN == 3) //web and win
                        {
                            DoSaveOption_WEB_AND_WIN_NET_ORA();
                        }
                    }
                }
                else if (NET_OR_JAVA == 2) //JAVA
                {
                }
            }
            else if (langNET.Equals("CS")) //C#
            {
                if (NET_OR_JAVA == 1) //.NET
                {
                    if (SS_OR_ORA == 1) //SS
                    {
                        if (WEB_OR_WIN == 1) //web
                        {
                            if (TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported)
                            {
                                DoSaveOption_WEB_NET_SS_CS();
                            }
                            else
                            {
                                DoSaveOption_WEB_NET_SS_NORMAL_CS();
                            }
                        }
                        else if (WEB_OR_WIN == 2) //win
                        {
                            DoSaveOption_WIN_NET_SS_CS();
                        }
                        else if (WEB_OR_WIN == 3) //web and win
                        {
                            if (TIENITCodeGener.Properties.Settings.Default.DotNetNuke_Supported)
                            {
                                DoSaveOption_WEB_AND_WIN_NET_SS_CS();
                            }
                            else
                            {
                                DoSaveOption_WEB_AND_WIN_NET_SS_NORMAL_CS();
                            }
                        }
                    }
                    else if (SS_OR_ORA == 2) //ORA
                    {
                        if (WEB_OR_WIN == 1) //web
                        {
                            DoSaveOption_WEB_NET_ORA_CS();
                        }
                        else if (WEB_OR_WIN == 2) //win
                        {
                            DoSaveOption_WIN_NET_ORA_CS();
                        }
                        else if (WEB_OR_WIN == 3) //web and win
                        {
                            DoSaveOption_WEB_AND_WIN_NET_ORA_CS();
                        }
                    }
                }
                else if (NET_OR_JAVA == 2) //JAVA
                {
                }
            }
        }

        //Do Gen For VB.NET
        private void DoSaveOption_WEB_NET_SS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                int total = 2 + 7 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "DataProvider.vb";
                string commonSqlDataProviderPath = dataProviderPath + "\\" + "SqlDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }
                DirectoryManager.CreateNewFile(commonSqlDataProviderPath, CommonFunction.web_net_ss_GenSqlDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".vb";
                    string sqlDataProviderForClassNamePath = dataProviderPath + "\\" + "SqlDataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_GenDataProvider(tblInfo, ARR_COLUMN);
                    string sqlDataProviderForClassNameContent = CommonFunction.web_net_ss_GenSQLDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(sqlDataProviderForClassNamePath, sqlDataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_NET_SS_NORMAL()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_normal_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ss_normal_GenSqlConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_normal_GenDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_normal_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_normal_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_normal_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_normal_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_normal_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WIN_NET_SS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.win_net_ss_GenSqlConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_SS()
        {
            try
            {
                //WEB
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                int total = 4 + 13 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "DataProvider.vb";
                string commonSqlDataProviderPath = dataProviderPath + "\\" + "SqlDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }
                DirectoryManager.CreateNewFile(commonSqlDataProviderPath, CommonFunction.web_net_ss_GenSqlDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".vb";
                    string sqlDataProviderForClassNamePath = dataProviderPath + "\\" + "SqlDataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_GenDataProvider(tblInfo, ARR_COLUMN);
                    string sqlDataProviderForClassNameContent = CommonFunction.web_net_ss_GenSQLDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_GenFormClass(tblInfo, ARR_COLUMN);
                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(sqlDataProviderForClassNamePath, sqlDataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }

                //WIN
                string genPath_win = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath_win = genPath_win + "\\" + "Component";
                string defPath_win = genPath_win + "\\" + "StoredProcedure";
                string dataProviderPath_win = abcPath_win + "\\" + "DataProvider";
                string infosPath_win = abcPath_win + "\\" + "Infos";
                string controllerPath_win = abcPath_win + "\\" + "Controller";
                string formsPath_win = genPath_win + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath_win, true);

                string commonDataProviderPath_win = dataProviderPath_win + "\\" + "CommonDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath_win, CommonFunction.win_net_ss_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath_win = dataProviderPath_win + "\\" + "SqlConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath_win, CommonFunction.win_net_ss_GenSqlConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath_win + "\\" + "DataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath_win + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath_win + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath_win + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath_win + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath_win + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_SS_NORMAL()
        {
            try
            {
                //WEB NORMAL
                LST_CLASS_NAME = GetTableClassName();

                int total = 4 + 12 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_normal_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ss_normal_GenSqlConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_normal_GenDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_normal_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_normal_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_normal_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_normal_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_normal_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }


                //WIN
                string genPath_win = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath_win = genPath_win + "\\" + "Component";
                string defPath_win = genPath_win + "\\" + "StoredProcedure";
                string dataProviderPath_win = abcPath_win + "\\" + "DataProvider";
                string infosPath_win = abcPath_win + "\\" + "Infos";
                string controllerPath_win = abcPath_win + "\\" + "Controller";
                string formsPath_win = genPath_win + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath_win, true);

                string commonDataProviderPath_win = dataProviderPath_win + "\\" + "CommonDataProvider.vb";
                DirectoryManager.CreateNewFile(commonDataProviderPath_win, CommonFunction.win_net_ss_GenDataProviderCommon());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath_win = dataProviderPath_win + "\\" + "SqlConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath_win, CommonFunction.win_net_ss_GenSqlConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath_win + "\\" + "DataProviderFor" + tblName + ".vb";
                    string infoForClassNamePath = infosPath_win + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath_win + "\\" + tblName + "Controller.vb";
                    string partialClassesPath = controllerPath_win + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath_win + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath_win + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WIN_NET_ORA()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Win_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 1 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.win_net_ora_GenOracleConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ora_GenDataAccess(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.win_net_ora_GenInfoClass(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.win_net_ora_GenBusinessObject(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.win_net_ora_GenPartialClasses(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.win_net_ora_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ora_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_NET_ORA()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 1+ 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ora_GenOracleConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ora_GenDataAccess(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.web_net_ora_GenInfoClass(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.web_net_ora_GenBusinessObject(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.web_net_ora_GenPartialClasses(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.web_net_ora_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ora_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_ORA()
        {
            try
            {
                //WEB
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 12 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ora_GenOracleConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ora_GenDataAccess(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.web_net_ora_GenInfoClass(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.web_net_ora_GenBusinessObject(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string patialClassesContent = CommonFunction.web_net_ora_GenPartialClasses(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.web_net_ora_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ora_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, patialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }

                //WIN
                genPath = ROOT_PATH + "\\" + "Gen_For_Win_ORA"; //Select case at here ...
                abcPath = genPath + "\\" + "Component";
                defPath = genPath + "\\" + "StoredProcedure";
                dataProviderPath = abcPath + "\\" + "DataAccess";
                infosPath = abcPath + "\\" + "ObjectInfo";
                controllerPath = abcPath + "\\" + "BusinessObject";
                formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath_Win = dataProviderPath + "\\" + "OracleConnect.vb";
                DirectoryManager.CreateNewFile(sqlConnectPath_Win, CommonFunction.win_net_ora_GenOracleConnect());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".vb";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.vb";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.vb";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.vb";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.vb";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ora_GenDataAccess(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.win_net_ora_GenInfoClass(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.win_net_ora_GenBusinessObject(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.win_net_ora_GenPartialClasses(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.win_net_ora_GenSQLStore(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ora_GenFormClass(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        //Do Gen For C#
        private void DoSaveOption_WEB_NET_SS_CS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                int total = 2 + 7 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "DataProvider.cs";
                string commonSqlDataProviderPath = dataProviderPath + "\\" + "SqlDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }
                DirectoryManager.CreateNewFile(commonSqlDataProviderPath, CommonFunction.web_net_ss_GenSqlDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".cs";
                    string sqlDataProviderForClassNamePath = dataProviderPath + "\\" + "SqlDataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string sqlDataProviderForClassNameContent = CommonFunction.web_net_ss_GenSQLDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(sqlDataProviderForClassNamePath, sqlDataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_NET_SS_NORMAL_CS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_normal_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ss_normal_GenSqlConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_normal_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_normal_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_normal_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_normal_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_normal_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_normal_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WIN_NET_SS_CS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.win_net_ss_GenSqlConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_SS_CS()
        {
            try
            {
                //WEB
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                int total = 4 + 13 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string commonDataProviderPath = dataProviderPath + "\\" + "DataProvider.cs";
                string commonSqlDataProviderPath = dataProviderPath + "\\" + "SqlDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }
                DirectoryManager.CreateNewFile(commonSqlDataProviderPath, CommonFunction.web_net_ss_GenSqlDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".cs";
                    string sqlDataProviderForClassNamePath = dataProviderPath + "\\" + "SqlDataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string sqlDataProviderForClassNameContent = CommonFunction.web_net_ss_GenSQLDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(sqlDataProviderForClassNamePath, sqlDataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }

                //WIN
                string genPath_win = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath_win = genPath_win + "\\" + "Component";
                string defPath_win = genPath_win + "\\" + "StoredProcedure";
                string dataProviderPath_win = abcPath_win + "\\" + "DataProvider";
                string infosPath_win = abcPath_win + "\\" + "Infos";
                string controllerPath_win = abcPath_win + "\\" + "Controller";
                string formsPath_win = genPath_win + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath_win, true);

                string commonDataProviderPath_win = dataProviderPath_win + "\\" + "CommonDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath_win, CommonFunction.win_net_ss_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath_win = dataProviderPath_win + "\\" + "SqlConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath_win, CommonFunction.win_net_ss_GenSqlConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath_win + "\\" + "DataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath_win + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath_win + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath_win + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath_win + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath_win + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_SS_NORMAL_CS()
        {
            try
            {
                //WEB NORMAL
                LST_CLASS_NAME = GetTableClassName();

                int total = 4 + 12 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_SS"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataProvider";
                string infosPath = abcPath + "\\" + "Infos";
                string controllerPath = abcPath + "\\" + "Controller";
                string formsPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath, true);

                string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.web_net_ss_normal_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath = dataProviderPath + "\\" + "SqlConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ss_normal_GenSqlConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + "DataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ss_normal_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.web_net_ss_normal_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.web_net_ss_normal_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.web_net_ss_normal_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.web_net_ss_normal_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ss_normal_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }


                //WIN
                string genPath_win = ROOT_PATH + "\\" + "Gen_For_Win_SS"; //Select case at here ...
                string abcPath_win = genPath_win + "\\" + "Component";
                string defPath_win = genPath_win + "\\" + "StoredProcedure";
                string dataProviderPath_win = abcPath_win + "\\" + "DataProvider";
                string infosPath_win = abcPath_win + "\\" + "Infos";
                string controllerPath_win = abcPath_win + "\\" + "Controller";
                string formsPath_win = genPath_win + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath_win, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formsPath_win, true);

                string commonDataProviderPath_win = dataProviderPath_win + "\\" + "CommonDataProvider.cs";
                DirectoryManager.CreateNewFile(commonDataProviderPath_win, CommonFunction.win_net_ss_GenDataProviderCommon_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                string sqlConnectPath_win = dataProviderPath_win + "\\" + "SqlConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath_win, CommonFunction.win_net_ss_GenSqlConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath_win + "\\" + "DataProviderFor" + tblName + ".cs";
                    string infoForClassNamePath = infosPath_win + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath_win + "\\" + tblName + "Controller.cs";
                    string partialClassesPath = controllerPath_win + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath_win + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formsPath_win + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_SQLSERVER(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ss_GenDataProvider_CS(tblInfo, ARR_COLUMN);
                    string infoForClassNameContent = CommonFunction.win_net_ss_GenInfoClass_CS(tblInfo, ARR_COLUMN);
                    string controllerForClassNameContent = CommonFunction.win_net_ss_GenControllerClass_CS(tblInfo, ARR_COLUMN);
                    string partialClassesContent = CommonFunction.win_net_ss_GenPartialClasses_CS(tblInfo, ARR_COLUMN);
                    string spForClassNameContent = CommonFunction.win_net_ss_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ss_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WIN_NET_ORA_CS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Win_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 1 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.win_net_ora_GenOracleConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ora_GenDataAccess_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.win_net_ora_GenInfoClass_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.win_net_ora_GenBusinessObject_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.win_net_ora_GenPartialClasses_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.win_net_ora_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ora_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_NET_ORA_CS()
        {
            try
            {
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 1 + 6 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ora_GenOracleConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ora_GenDataAccess_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.web_net_ora_GenInfoClass_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.web_net_ora_GenBusinessObject_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.web_net_ora_GenPartialClasses_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.web_net_ora_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ora_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }

        private void DoSaveOption_WEB_AND_WIN_NET_ORA_CS()
        {
            try
            {
                //WEB
                LST_CLASS_NAME = GetTableClassName();

                string genPath = ROOT_PATH + "\\" + "Gen_For_Web_ORA"; //Select case at here ...
                string abcPath = genPath + "\\" + "Component";
                string defPath = genPath + "\\" + "StoredProcedure";
                string dataProviderPath = abcPath + "\\" + "DataAccess";
                string infosPath = abcPath + "\\" + "ObjectInfo";
                string controllerPath = abcPath + "\\" + "BusinessObject";
                string formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                int total = 2 + 12 * LST_CLASS_NAME.Count;
                int countForGen = 0;
                int percent = 0;

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath = dataProviderPath + "\\" + "OracleConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath, CommonFunction.web_net_ora_GenOracleConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.web_net_ora_GenDataAccess_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.web_net_ora_GenInfoClass_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.web_net_ora_GenBusinessObject_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.web_net_ora_GenPartialClasses_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.web_net_ora_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.web_net_ora_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }

                //WIN
                genPath = ROOT_PATH + "\\" + "Gen_For_Win_ORA"; //Select case at here ...
                abcPath = genPath + "\\" + "Component";
                defPath = genPath + "\\" + "StoredProcedure";
                dataProviderPath = abcPath + "\\" + "DataAccess";
                infosPath = abcPath + "\\" + "ObjectInfo";
                controllerPath = abcPath + "\\" + "BusinessObject";
                formPath = genPath + "\\" + "Forms";

                DirectoryManager.CreateNewDirectoryWithCheck(genPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(abcPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(defPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(dataProviderPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(infosPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(controllerPath, true);
                DirectoryManager.CreateNewDirectoryWithCheck(formPath, true);

                //string commonDataProviderPath = dataProviderPath + "\\" + "CommonDataProvider.vb";
                //DirectoryManager.CreateNewFile(commonDataProviderPath, CommonFunction.win_net_ss_GenDataProviderCommon());
                //countForGen = countForGen + 1;
                //percent = (int)100 * countForGen / total;
                //if (percent > 100)
                //{
                //    worker.ReportProgress(100);
                //}
                //else
                //{
                //    worker.ReportProgress(percent);
                //}

                string sqlConnectPath_Win = dataProviderPath + "\\" + "OracleConnect.cs";
                DirectoryManager.CreateNewFile(sqlConnectPath_Win, CommonFunction.win_net_ora_GenOracleConnect_CS());
                countForGen = countForGen + 1;
                percent = (int)100 * countForGen / total;
                if (percent > 100)
                {
                    worker.ReportProgress(100);
                }
                else
                {
                    worker.ReportProgress(percent);
                }

                foreach (string tblInfo in LST_CLASS_NAME)
                {
                    string tblName = GetTableClassFromTableName(tblInfo);

                    string dataProviderForClassNamePath = dataProviderPath + "\\" + tblName + "DAO" + ".cs";
                    string infoForClassNamePath = infosPath + "\\" + tblName + "Info.cs";
                    string controllerForClassNamePath = controllerPath + "\\" + tblName + "BO.cs";
                    string partialClassesPath = controllerPath + "\\" + tblName + "PartialClasses.cs";
                    string spForClassNamePath = defPath + "\\" + tblName + "_StoredProcedure.sql";
                    string formClassPath = formPath + "\\" + tblName + "Form.cs";

                    ARR_COLUMN = GET_LIST_COLUMN_ORACLE(tblInfo);

                    string dataProviderForClassNameContent = CommonFunction.win_net_ora_GenDataAccess_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_Package_Name, CommonInfo.Oracle_TableClassPrefix);
                    string infoForClassNameContent = CommonFunction.win_net_ora_GenInfoClass_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string controllerForClassNameContent = CommonFunction.win_net_ora_GenBusinessObject_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string partialClassesContent = CommonFunction.win_net_ora_GenPartialClasses_CS(tblInfo, ARR_COLUMN, CommonInfo.Oracle_TableClassPrefix);
                    string spForClassNameContent = CommonFunction.win_net_ora_GenSQLStore_CS(tblInfo, ARR_COLUMN);
                    string formClassContent = CommonFunction.win_net_ora_GenFormClass_CS(tblInfo, ARR_COLUMN);

                    DirectoryManager.CreateNewFile(dataProviderForClassNamePath, dataProviderForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(infoForClassNamePath, infoForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(controllerForClassNamePath, controllerForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(partialClassesPath, partialClassesContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(spForClassNamePath, spForClassNameContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                    DirectoryManager.CreateNewFile(formClassPath, formClassContent);
                    countForGen = countForGen + 1;
                    percent = (int)100 * countForGen / total;
                    if (percent > 100)
                    {
                        worker.ReportProgress(100);
                    }
                    else
                    {
                        worker.ReportProgress(percent);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ITFACommon.Message_Error(ex);
            }
        }


        private void btnGen_Click(object sender, EventArgs e)
        {
            try
            {
                //1:Web, 2:Win, 3:Web and Win
                WEB_OR_WIN = TIENITCodeGener.Properties.Settings.Default.Web_Or_Win_Or_All;
                FolderBrowserDialog fbd = new FolderBrowserDialog();
                if (fbd.ShowDialog() == DialogResult.OK)
                {
                    ROOT_PATH = fbd.SelectedPath;
                    LST_CLASS_NAME = GetTableClassName();

                    worker.RunWorkerAsync();
                    m_Frm_Loading = new frmLoading();
                    m_Frm_Loading.lbl_Percent_Value.Visible = true;
                    m_Frm_Loading.lbl_Percent_Symbol.Visible = true;
                    m_Frm_Loading.ShowDialog();
                }
            }
            catch
            {
            }
        }
#endregion

#region "Format Code"
        private void CSharpSyntaxHighlight(FastColoredTextBox fctb, TextChangedEventArgs e)
        {
            //fctb.LeftBracket = '(';
            //fctb.RightBracket = ')';
            //fctb.LeftBracket2 = '\x0';
            //fctb.RightBracket2 = '\x0';
            ////clear style of changed range
            //e.ChangedRange.ClearStyle(BlueStyle, BoldStyle, GrayStyle, MagentaStyle, GreenStyle, BrownStyle);

            ////string highlighting
            //e.ChangedRange.SetStyle(BrownStyle, @"""""|@""""|''|@"".*?""|(?<!@)(?<range>"".*?[^\\]"")|'.*?[^\\]'");
            ////comment highlighting
            //e.ChangedRange.SetStyle(GreenStyle, @"//.*$", RegexOptions.Multiline);
            //e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(/\*.*)", RegexOptions.Singleline);
            //e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(.*\*/)", RegexOptions.Singleline | RegexOptions.RightToLeft);
            ////number highlighting
            //e.ChangedRange.SetStyle(MagentaStyle, @"\b\d+[\.]?\d*([eE]\-?\d+)?[lLdDfF]?\b|\b0x[a-fA-F\d]+\b");
            ////attribute highlighting
            //e.ChangedRange.SetStyle(GrayStyle, @"^\s*(?<range>\[.+?\])\s*$", RegexOptions.Multiline);
            ////class name highlighting
            //e.ChangedRange.SetStyle(BoldStyle, @"\b(class|struct|enum|interface)\s+(?<range>\w+?)\b");
            ////keyword highlighting
            //e.ChangedRange.SetStyle(BlueStyle, @"\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b|#region\b|#endregion\b");

            ////clear folding markers
            //e.ChangedRange.ClearFoldingMarkers();
            ////set folding markers
            //e.ChangedRange.SetFoldingMarkers("{", "}");//allow to collapse brackets block
            //e.ChangedRange.SetFoldingMarkers(@"#region\b", @"#endregion\b");//allow to collapse #region blocks
            //e.ChangedRange.SetFoldingMarkers(@"/\*", @"\*/");//allow to collapse comment block
        }

        private void CSFormat(FastColoredTextBox fctb)
        {
            FastColoredTextBoxNS.Range rg = new FastColoredTextBoxNS.Range(fctb, 0, 6, 1, fctb.Lines.Count - 1);
            fctb.Selection = rg;
            fctb.DoAutoIndent();
            fctb.IncreaseIndent();
            fctb.DecreaseIndent();
        }

        private void CSFormat_ORA(FastColoredTextBox fctb)
        {
            FastColoredTextBoxNS.Range rg = new FastColoredTextBoxNS.Range(fctb, 0, 9, 1, fctb.Lines.Count - 1);
            fctb.Selection = rg;
            fctb.DoAutoIndent();
            fctb.IncreaseIndent();
            fctb.DecreaseIndent();
        }
#endregion

    }
}
